package com.wyk.AOP;

import com.wyk.Service.Impl.UserServiceImpl;
import com.wyk.Spring.BeanPostProcessor;
import com.wyk.Spring.Component;

/**
 * @ClassName: UserBeanPostProcessor
 * @Description:
 * @Author: 初久
 * @Date: 2022/7/4 13:15
 **/
@Component
public class UserBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(String beanName, Object bean) {
        if (bean.getClass() == UserServiceImpl.class) {
            System.out.println(beanName + "前置通知~");
        }
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(String beanName, Object bean) {
        return bean;
    }
}
